package com.tengju.support.domain.model.message;

import org.redisson.api.RLock;

import java.time.LocalDateTime;
import java.util.List;

public interface MessageTaskRepository {

    List<MessageTask> getBySendStatusLessSendTime(SendStatus sendStatus, LocalDateTime sendTime);

    List<MessageTask> getBySendStatus(SendStatus sendStatus);

    TaskId save(MessageTask messageContent);

    MessageTask get(TaskId messageId);

    void edit(MessageTask messageContent);

    void remove(TaskId messageId, String updateBy);

    int getPageTotal(String keyword, List<MessageType> messageTypeList);

    List<MessageTask> getPage(String keyword, List<MessageType> messageTypeList, Integer offset, Integer limit);

    RLock getBatchInitLock(TaskId messageId);

    boolean updateSendStatus(TaskId messageId, SendStatus beforeStatus, SendStatus afterStatus);
}
